﻿/******************************************************************************
 * Copyright (C) 2015  671643387@qq.com
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 *****************************************************************************/

#ifndef UCOP_TYPEDEFS_H_
#define UCOP_TYPEDEFS_H_

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif

#include <cstddef>
#include <cstdint>
#include <string>


namespace Ucop {

    typedef std::int8_t     Int8;
    typedef std::int16_t    Int16;
    typedef std::int32_t    Int32;
    typedef std::int64_t    Int64;

    typedef std::uint8_t    UInt8;
    typedef std::uint16_t   UInt16;
    typedef std::uint32_t   UInt32;
    typedef std::uint64_t   UInt64;

#ifdef _UNICODE
    typedef wchar_t         Char;
    typedef std::wstring    String;

#define __L(x)              L ## x
#define _Lprintf            wprintf
#else
    typedef char            Char;
    typedef std::string     String;

#define __L(x)              x
#define _Lprintf            printf
#endif

    /* Define NULL pointer value */
#ifndef NULL
#ifdef __cplusplus
#define NULL    0
#else
#define NULL    ((void *)0)
#endif
#endif

#define _L(x)               __L(x)

}

#endif // UCOP_TYPEDEFS_H_
